package com.dmz.wxcp.wecom.contact.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dmz.wxcp.wecom.contact.entity.Contact;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ContactMapper extends BaseMapper<Contact> {


    @Select("select * from contact where openid=#{openId}")
    Contact getContactByOpenId(@Param("openId") String openid);

    @Select("select * from contact where userid=#{userid}")
    Contact getContactByUserid(@Param("userid") String userid);

    @Select("select count(*) from contact where openid=#{openid}")
    Integer selectCountByOpenId(String openid);
}
